#!/bin/bash

date="$(date)"

if [ ! "$2" = "-cpp" ]
then
apply_template.sh -tpl cpp-class-h.tpl -sep @@ -args LICENSE_HEADER CLASSNAME DATE \
-values "$(cat -e LICENSE_header)"@@$1@@"$date" -out src/$1.tmp.h
\cat src/$1.tmp.h | tr '$' '\n' > src/$1.h && rm src/$1.tmp.h
\svn add src/$1.h
fi

if [ ! "$2" = "-h" ]
then
apply_template.sh -tpl cpp-class-cpp.tpl -sep @@ -args LICENSE_HEADER CLASSNAME DATE \
-values "$(cat -e LICENSE_header)"@@$1@@"$date" -out src/$1.tmp.cpp
\cat src/$1.tmp.cpp | tr '$' '\n' > src/$1.cpp && rm src/$1.tmp.cpp
\svn add src/$1.cpp
fi

